<template>
  <!-- 支付交易信息明细页面弹出框-->
  <el-dialog
    title="支付交易信息明细"
    center
    :visible.sync="openStatus"
    width="1024px"
    :close-on-click-modal="false"
    :append-to-body="true"
    @close="closeFn"
  >
    <el-form ref="detailsForm2" :model="detailsData" label-width="180px" :disabled="true">
      <el-row>
        <el-col :span="24">
          <el-form-item label="明细流水号：" prop="id">
            <el-input v-model="detailsData.id" placeholder="明细流水号" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="贷记清算行行号：" prop="cStBrno">
            <el-input v-model="detailsData.cStBrno" placeholder="贷记清算行行号" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="贷记清算行名称：" prop="cStBrname">
            <el-input v-model="detailsData.cStBrname" placeholder="贷记清算行名称" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="借记清算行行号：" prop="dStBrno">
            <el-input v-model="detailsData.dStBrno" placeholder="借记清算行行号" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="借记清算行名称：" prop="dStBrname">
            <el-input v-model="detailsData.dStBrname" placeholder="借记清算行名称" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="业务协议号：" prop="protoNum">
            <el-input v-model="detailsData.protoNum" placeholder="业务协议号" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="拆入行剩余可用拆借额度币种：" prop="rmngAmtCurcd">
            <el-select v-model="detailsData.rmngAmtCurcd" placeholder="请选择" style="width: 100%">
              <el-option
                v-for="dict in dictMap.CURCD"
                :key="dict.value"
                :label="`${dict.value}-${dict.text}`"
                :value="dict.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="拆入行剩余可用拆借额度：" prop="rmngAmt">
            <el-input v-model="detailsData.rmngAmt" placeholder="拆入行剩余可用拆借额度" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="交易明细数目：" prop="dtlNum">
            <el-input v-model="detailsData.dtlNum" placeholder="交易明细数目" />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div style="height: 300px">
      <ht-table
        ref="ostInfoTable"
        :showSerialNumber="false"
        :multi-select="false"
        :dictMap="dictMap"
        :reqConfig="reqConfig"
        :initData="false"
        :randomRowKey="true"
        :canHideColumns="false"
        :canHideSearch="false"
        :canRefresh="false"
        :queryParams="queryParams"
        :tableBindColumns="tableBindColumns"
        :opButtonList="opButtonList"
        style="height: 100%"
      ></ht-table>
    </div>

    <div slot="footer" class="dialog-footer">
      <el-button @click="closeFn">关闭</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { reDetailTabsearch } from "@/api/cnaps/saps/poolingAndAutoMng/funds_borrow_result.js";
import { log } from "util";
import { amountThousandsFormatter } from "@/utils/table_col_formatter";
export default {
  name: "OstInfo",
  components: {},
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
    detailsData: {
      type: Object,
      default: () => {
        return {};
      },
    },
    formData: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      reqConfig: reDetailTabsearch,
      // 是否显示弹出层
      openStatus: false,
      // 查询参数
      queryParams: {
        id: "",
      },
      opButtonList: () => {
        return [];
      },
      tableBindColumns: [
        {
          label: `支付交易序号`,
          prop: "txnId",
          width: "200",
          sortable: false,
        },
        {
          label: `币种`,
          prop: "curcd",
          dict: "CURCD",
          align: "center",
          sortable: false,
        },
        {
          label: `金额`,
          prop: "amount",
          width: "160",
          sortable: false,
          type: "price",
        },
      ],
    };
  },
  mounted() {},
  watch: {
    openStatus(d) {
      if (d) {
        this.$nextTick(() => {
          this.$set(this.queryParams, "id", this.detailsData.id);
          this.$refs.ostInfoTable.doQuery();
        });
      }
    },
  },
  methods: {
    // 表单重置
    reset() {
      this.resetForm("detailsForm2");
      // this.$set(this, "form", {});
    },
    closeFn() {
      this.openStatus = false;
      this.reset();
    },
    show() {
      this.openStatus = true;
    },
  },
};
</script>
